//
//  UserListProtocol.swift
//  demo
//
//  Created by 刘洪宝 on 2025/2/9.
//

import UIKit

// View Protocol
protocol UserListViewProtocol: AnyObject {
    var presenter: UserListPresenterProtocol? { get set }
    func showUsers(_ users: [User])
    func showLoading()
    func hideLoading()
    func showError(_ message: String)
}

// Presenter Protocol
protocol UserListPresenterProtocol: AnyObject {
    var view: UserListViewProtocol? { get set }
    var interactor: UserListInteractorProtocol? { get set }
    var router: UserListRouterProtocol? { get set }
    
    func viewDidLoad()
    func didSelectUser(_ user: User)
}

// Interactor Protocol

protocol UserListInteractorProtocol: AnyObject {
    var presenter: UserListInteractorOutputProtocol? { get set }
    func fetchUsers()
}

// Interactor Output Protocol (Presenter will implement this)
protocol UserListInteractorOutputProtocol: AnyObject {
    func usersFetched(_ users: [User])
    func usersFetchFailed(_ error: Error)
}

// Router Protocol
protocol UserListRouterProtocol: AnyObject {
    static func createUserListModule() -> UIViewController
    func navigateToUserDetail(from view: UserListViewProtocol?, user: User)
} 
